<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge" >
  <title>效率提升--代码仓库 | BoBo&#39;Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="开发过程中经常遇到重复或者相似代码，如何能更有效率的使用这些代码，xcode的做法是提供代码仓库来保存我们经常使用的代码块。 操作也很简单，鼠标长按选中代码块，2秒左右鼠标变成黑色箭头后拖动至右下角代码仓库,右键edit编辑对应的快捷名称。 如图： title：代码块名称 summary：简介 completion shortcut :调用快捷短语 另外若是想生成代码模板，内含一些可变参数，可以在">
<meta property="og:type" content="article">
<meta property="og:title" content="效率提升--代码仓库">
<meta property="og:url" content="https://www.boboios.cn/2016/06/21/%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87--%E4%BB%A3%E7%A0%81%E4%BB%93%E5%BA%93/index.html">
<meta property="og:site_name" content="BoBo&#39;Blog">
<meta property="og:description" content="开发过程中经常遇到重复或者相似代码，如何能更有效率的使用这些代码，xcode的做法是提供代码仓库来保存我们经常使用的代码块。 操作也很简单，鼠标长按选中代码块，2秒左右鼠标变成黑色箭头后拖动至右下角代码仓库,右键edit编辑对应的快捷名称。 如图： title：代码块名称 summary：简介 completion shortcut :调用快捷短语 另外若是想生成代码模板，内含一些可变参数，可以在">
<meta property="og:image" content="http://7xkrmk.com1.z0.glb.clouddn.com/2016-06-21%20%E4%B8%8B%E5%8D%884.07.02.png">
<meta property="article:published_time" content="2016-06-21T07:42:58.000Z">
<meta property="article:modified_time" content="2019-02-13T06:53:02.962Z">
<meta property="article:author" content="Lv Bo">
<meta property="article:tag" content="iOS技巧">
<meta property="article:tag" content="开发效率">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://7xkrmk.com1.z0.glb.clouddn.com/2016-06-21%20%E4%B8%8B%E5%8D%884.07.02.png">
  
    <link rel="alternative" href="/atom.xml" title="BoBo&#39;Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="https://gitee.com/lvboios/PictureBed/raw/master/uPic/IMG_1199.JPG" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">Lv Bo</a></h1>
		</hgroup>

		
		<p class="header-subtitle">Your name my heart</p>
		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						
						<div class="icon-wrap icon-me hide" data-idx="3">
							<div class="user"></div>
							<div class="shoulder"></div>
						</div>
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						
						<li>关于我</li>
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
								<a class="github" target="_blank" href="https://github.com/BoBoMoon" title="github">github</a>
					        
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						<a href="/tags/Flutter/" style="font-size: 10px;">Flutter</a> <a href="/tags/app%E5%AE%89%E5%85%A8/" style="font-size: 10px;">app安全</a> <a href="/tags/iOS%E6%8A%80%E5%B7%A7/" style="font-size: 20px;">iOS技巧</a> <a href="/tags/iOS%E7%9F%A5%E8%AF%86%E5%8F%8A%E5%8E%9F%E7%90%86/" style="font-size: 15px;">iOS知识及原理</a> <a href="/tags/%E5%85%B6%E4%BB%96%E8%AF%AD%E8%A8%80/" style="font-size: 10px;">其他语言</a> <a href="/tags/%E5%91%A8%E8%BE%B9%E8%BD%AF%E4%BB%B6/" style="font-size: 10px;">周边软件</a> <a href="/tags/%E5%BC%80%E5%8F%91%E6%95%88%E7%8E%87/" style="font-size: 10px;">开发效率</a> <a href="/tags/%E5%BF%83%E5%BE%97%E4%BD%93%E4%BC%9A/" style="font-size: 10px;">心得体会</a> <a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 10px;">算法</a> <a href="/tags/%E8%A3%85%E9%80%BC%E4%B8%93%E7%94%A8/" style="font-size: 10px;">装逼专用</a>
					</div>
				</section>
				
				
				

				
				
				<section class="switch-part switch-part3">
				
					<div id="js-aboutme">莫疑春归无觅处，静待花开会有时</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">Lv Bo</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
			
				<img lazy-src="https://gitee.com/lvboios/PictureBed/raw/master/uPic/IMG_1199.JPG" class="js-avatar">
			
			</div>
			<hgroup>
			  <h1 class="header-author">Lv Bo</h1>
			</hgroup>
			
			<p class="header-subtitle">Your name my heart</p>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/BoBoMoon" title="github">github</a>
			        
				</div>
			</nav>
		</header>				
	</div>
</nav>

      <div class="body-wrap"><article id="post-效率提升--代码仓库" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2016/06/21/%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87--%E4%BB%A3%E7%A0%81%E4%BB%93%E5%BA%93/" class="article-date">
  	<time datetime="2016-06-21T07:42:58.000Z" itemprop="datePublished">2016-06-21</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      效率提升--代码仓库
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
	<div class="article-tag tagcloud">
		<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/iOS%E6%8A%80%E5%B7%A7/" rel="tag">iOS技巧</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%BC%80%E5%8F%91%E6%95%88%E7%8E%87/" rel="tag">开发效率</a></li></ul>
	</div>

        

        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>开发过程中经常遇到重复或者相似代码，如何能更有效率的使用这些代码，xcode的做法是提供代码仓库来保存我们经常使用的代码块。</p>
<p>操作也很简单，鼠标长按选中代码块，2秒左右鼠标变成黑色箭头后拖动至右下角代码仓库,右键edit编辑对应的快捷名称。</p>
<p>如图：<br><img src="http://7xkrmk.com1.z0.glb.clouddn.com/2016-06-21%20%E4%B8%8B%E5%8D%884.07.02.png" alt="p1"></p>
<p>title：代码块名称</p>
<p>summary：简介</p>
<p>completion shortcut :调用快捷短语</p>
<h5 id="另外若是想生成代码模板，内含一些可变参数，可以在参数位置用-lt-name-gt-修饰，name可根据情况自取"><a href="#另外若是想生成代码模板，内含一些可变参数，可以在参数位置用-lt-name-gt-修饰，name可根据情况自取" class="headerlink" title="另外若是想生成代码模板，内含一些可变参数，可以在参数位置用&lt;#name#&gt;修饰，name可根据情况自取"></a>另外若是想生成代码模板，内含一些可变参数，可以在参数位置用&lt;#name#&gt;修饰，name可根据情况自取</h5><h4 id="自己定义的code-snippet配置文件默认放在-Library-Developer-Xcode-UserData-CodeSnippets-如果在不同的机子上开发-要把这个目录下的文件拷走复制。"><a href="#自己定义的code-snippet配置文件默认放在-Library-Developer-Xcode-UserData-CodeSnippets-如果在不同的机子上开发-要把这个目录下的文件拷走复制。" class="headerlink" title="自己定义的code snippet配置文件默认放在~/Library/Developer/Xcode/UserData/CodeSnippets/如果在不同的机子上开发,要把这个目录下的文件拷走复制。"></a>自己定义的code snippet配置文件默认放在<code>~/Library/Developer/Xcode/UserData/CodeSnippets/</code>如果在不同的机子上开发,要把这个目录下的文件拷走复制。</h4>
      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/02/13/%E4%BF%AE%E6%94%B9%E9%A1%B9%E7%9B%AE%E5%86%85%E6%9F%90%E4%B8%AA%E6%8E%A7%E4%BB%B6%E7%9A%84%E5%85%A8%E5%B1%80%E5%B1%9E%E6%80%A7/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption"><</strong>
      <div class="article-nav-title">
        
          修改项目内某个控件的全局属性
        
      </div>
    </a>
  
  
    <a href="/2016/06/21/iOS%E4%BB%A3%E7%A0%81%E6%B7%B7%E6%B7%86/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">iOS代码混淆</div>
      <strong class="article-nav-caption">></strong>
    </a>
  
</nav>

  
</article>


<div class="share_jia">
	<!-- JiaThis Button BEGIN -->
	<div class="jiathis_style">
		<span class="jiathis_txt">分享到: &nbsp; </span>
		<a class="jiathis_button_facebook"></a> 
    <a class="jiathis_button_twitter"></a>
    <a class="jiathis_button_plus"></a> 
    <a class="jiathis_button_tsina"></a>
		<a class="jiathis_button_cqq"></a>
		<a class="jiathis_button_douban"></a>
		<a class="jiathis_button_weixin"></a>
		<a class="jiathis_button_tumblr"></a>
    <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	</div>
	<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=1405949716054953" charset="utf-8"></script>
	<!-- JiaThis Button END -->
</div>






<div class="duoshuo">
	<!-- 多说评论框 start -->
	<div class="ds-thread" data-thread-key="效率提升--代码仓库" data-title="效率提升--代码仓库" data-url="https://www.boboios.cn/2016/06/21/%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87--%E4%BB%A3%E7%A0%81%E4%BB%93%E5%BA%93/"></div>
	<!-- 多说评论框 end -->
	<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"lvboios"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
	<!-- 多说公共JS代码 end -->
</div>




</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left”>
    		&copy; 2020 Lv Bo
    	</div>
      	<div class="footer-right">
      		<a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
      	</div>
    </div>
  </div>
</footer>
    </div>
    
  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">



<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>

<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>


<script src="/js/main.js"></script>







<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  </div>
</body>
</html>